import sys
if __name__ == '__main__':
    fn = sys.argv[1]
    tm = float(sys.argv[2])
    first_line = None
    last_line = None  
    with open(fn, 'r') as file:
        first_line = file.readline().strip()
        for line in file:  
            last_line = line.strip()

    start_tx_bytes, start_rx_bytes = first_line.split(': ')[1].split(' ')
    end_tx_bytes, end_rx_bytes = last_line.split(': ')[1].split(' ')

    total_traff = (int(end_tx_bytes) - int(start_tx_bytes)) * 8 / 10**9
    avg_bw = total_traff / ((tm/1000) * 100)
    print('total traff (Gb): ', total_traff)
    print('avg bw (Gbps): ', avg_bw)